<template>
  <div class="container">
    <div class="cheader2">
      <van-icon
        @click="goBack"
        class="chl"
        name="arrow-left"
        color="#000"
        size="20"
      />
      <div class="chtitle">通知公告</div>
      <div class="djbox"></div>
    </div>
    <div class="abbox">
      <div
        class="libox"
        v-for="(item, index) in notices"
        :key="item.id"
        @click="toDetail(item)"
      >
        {{ index + 1 }}. {{ item.title }}
      </div>
    </div>
  </div>
</template>
  
  <script setup lang='ts'>
import { useRouter } from "vue-router";
import { computed } from "vue";
import { useStore } from "@/store";
const store = useStore();
const notices = computed(() => store.state.systems.notices);
const router = useRouter();
const toDetail = (item: any) => {
  if (item.textContent) {
    store.commit("systems/updateDatas", {
      key: "detailContent",
      data: item,
    });
    router.push("/acticaldetail");
  }
};
const goBack = () => {
  router.go(-1);
};
</script>
  
  <style lang="scss" scoped>
.cheader2 {
  z-index: 1001;
  width: 100%;
  height: 45px;
  background-color: #fff;
  font-size: 16px;
  color: #000;
  position: fixed;
  top: 0;
  left: 0;
  .chl {
    position: absolute;
    left: 16px;
    top: 50%;
    text-align: center;
    transform: translateY(-50%);
  }
  .chtitle {
    position: absolute;
    left: 50%;
    top: 50%;
    text-align: center;
    transform: translate(-50%, -50%);
  }
  .djbox {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    img {
      width: 16px;
      margin-right: 4px;
    }
    div {
      font-size: 13px;
      color: #878b97;
    }
  }
}
.abbox {
  padding: 20px 20px;
  margin-top:45px;
  .libox {
    color: #000;
    height: 45px;
    align-items: center;
    display: flex;
  }
}
</style>